<?php
class Sfs_View_Helper_TeacherNameOptions
{
	function TeacherNameOptions($selected='')
	{
		// 教師
		$teacher = new Teacher_Model_Teacher();
		$arr = $teacher->getTeachers();
		$str = '';
		foreach ($arr as $id=>$vals){
			//if (isset($kind_arr[$id]))
			$str .='<optgroup label="'.$id.'">'."\n";
			foreach ($vals as $val) {
				if ($selected == $val['sn'])
				$str .='<option value="'.$val['sn'].'" selected>'.$val['name'].'</option>'."\n";
				else
				$str .='<option value="'.$val['sn'].'">'.$val['name'].'</option>'."\n";
			}
			$str .="</optgroup>\n";
		}
		return $str;
	}
}
